<div class="announcementsTitle"><?php echo "Contact"; ?></div>
 

	  <div class="homeTabs">
	  <?php
	 /* $agencyId=getAgencyId();
$sSql ="Select agencys.* From immo_agencys agencys Where agencys.id = ".$agencyId;
      $rs=$GLOBALS["conn"]->Execute($sSql); 
	  
*/


?>



<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
<table>
<tr valign="top">
<td  width="100%">
<div class="headline"><?php echo ""; ?> : <?php echo ""; ?></div>
<div class="title"><?php echo ""; ?></div>
<div class="title"><?php echo ""; ?></div>


<?php
 if (getParameter("send_message")!=null) {
if (smtpmailer("", GUSER, getParameter("name"), 'Contact Site :'.getParameter("from"), getParameter("body"))) {
	// do something

//if (!empty($error)) echo $error;
?>
<div class="pam_title"><?php echo "message sent";?></div>
<?php
}}
?>
</td>
<td width="500px">
<div class="pam_title"><?php echo "plan"; ?> : </div>
<div id='map' style='width: 500px; height: 300px;'>test</div>
</td>
</tr>
<tr>
<td colspan="2">


<br/>




 <form action="<?php echo curPageURI();?>" method="POST">
 <input type="hidden" name="send_message" value="true"/>
 <table>
 <tr>
 <td style="width: 140px;"><span class="pam_title" ><?php echo "name"; ?></span></td>
 <td> <input type="text" name="name" id="name" size="100" value="" style="width:350px;margin-bottom:15px;height:30px"></td>
 </tr>
  <tr>
 <td><span class="pam_title"><?php echo "mail"; ?></span></td>
 <td> <input type="text" name="from" size="100" value="" style="width:350px;margin-bottom:15px;height:30px"></td>
 </tr>
  <tr valign="top">
 <td><span class="pam_title"><?php echo "message"; ?></span></td>
 <td> <textarea  name="body" id="body" cols="70" rows="10"></textarea>
<BR/><BR/><input type="submit" value="  <?php echo "send"; ?>  "></td>
 </tr>
 </table>

 
 </form>
 
 <script type="text/javascript">

if (typeof(Yamli) == "object" && Yamli.init( { uiLanguage: "ar" , startMode: "onOrUserDefault" } ))
  {
    Yamli.yamlify( "name", { settingsPlacement: "bottomLeft" } );
  }
  
if (typeof(Yamli) == "object" && Yamli.init( { uiLanguage: "ar" , startMode: "onOrUserDefault" } ))
{
  Yamli.yamlify( "body", { settingsPlacement: "bottomLeft" } );
}
  
  </script>
 
 <style>

    .pam_title{
    
    font-size: 16px;
    }
 </style>

</td>
</tr>
</table>
<?php if (ew_CurrentPage()!="portlet.php") {?>
<script  type="text/javascript">

  
  
    var map;
 var image = 'images/icons/tool_marker.png';
 // var marker;
var glocations=new Array();    
    
     function initialize(ka,la,z) {
    var latlng = new google.maps.LatLng(ka,la);
    var myOptions = {
      zoom: z,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };  

    
     map = new google.maps.Map(document.getElementById("map"), myOptions);                                                  
                         
  }
 $(document).ready(function() {

  

    initialize(<?php echo $rs->fields["latitude"]; ?>,<?php echo $rs->fields["longitude"]; ?>,<?php echo $rs->fields["zoom"]; ?>); 
glocations.push({location:new google.maps.LatLng(<?php echo $rs->fields["latitude"]; ?>, <?php echo $rs->fields["longitude"]; ?>),title:"Agence : <?php echo $rs->fields["name"]; ?>"})    
    for (var i=0;i<glocations.length;i++)
    {
    placeMarker(glocations[i]);
    }
    });    

	
function placeMarker(loc) {
  var clickedLocation = new google.maps.LatLng(loc.location);
 var  marker = new google.maps.Marker({
      position: loc.location, 
      map: map,
       icon: image,
       title: loc.title
  });
   var contentString = '<div id="content">'+
        '<p>'+loc.title+'</p>'+
        '</div>';
  google.maps.event.addListener(marker, 'click', function() {
      new google.maps.InfoWindow({
        content: contentString
    }).open(map,marker);
    
    });
  map.setCenter(loc.location);
}     



</script>

<script  type="text/javascript">


	 tinyMCE.init({
		  mode : "textareas",
	      theme : "simple",
	      directionality :"<?php echo $dir; ?>",
	    height:"260px",
	    width:"527px"
	});



</script>
<?php } ?>

</div>
